local CommonOHOH = _G.CommonOHOH;
local M = CommonOHOH.class.new(script, CommonOHOH.files.BaseComponent());
local CallBackManager = CommonOHOH.load.CallBackManager();

function M.new(self,...)
	return M(self,...);
end;

function M.ctor(self, parent)
	M.super.ctor(self, parent);
	self.car=self.parent
	self.player=self.parent.player

	self:Init()
	self:UpdateSpeed()
end;
function M.Init(self)
	if self.player then
		self.CarInfoCtrl=self.player:GetComponent(_G.CommonOHOH.load.Common_CarInfoCtrl())
		CallBackManager:AddRbxConnect(self,self.CarInfoCtrl.UpdateEvent, function()
			self:UpdateSpeed()
			
		end);
	end
end
--更新前进速度
function M.UpdateSpeed(self)
	--推进力
	

	if self.CarInfoCtrl then
		local attack=self.CarInfoCtrl:GetAttack()
		-- print("攻击力-->",attack)
		self.car:SetDrillingSpeed(5)
	else
		self.car:SetDrillingSpeed(5)
	end
end


function M.dtor(self)

	M.super.dtor(self);
end


return M